<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>店内推广</title>

</head>
<script type="text/javascript">
$(document).ready(function(){
	getRadio();
});


function  getRadio(){
	$.ajax({
		  type:'get',
		  url: "innerStore/getProgress",  
		  success: function(radio){
			 // alert(radio);
		    $('#showRadio').html(radio);
		    if(radio==0||radio==100){
		    	$('#innerSubmit').attr('readonly',true); 
		    }else{
		    	$('#innerSubmit').attr('readonly',false);
		    }
		    
		    setTimeOut(function(){
		    	getRadio();
		    }, 1000);
		  }
		});
	
}
   
$(function(){
	$('#addMsg').live('click', function(){
		$.ajax({
			  type:'post',
			  url: "innerStore/getinnserStroeBody",
			  data:{styleType:'#534537',
				  tuiguangName:'测试',
				  cosCount:1,
				  rowCount:5
				  },
			  success: function(data){
				  alert(data.table);
			    $('#inbody').append(data);
			  }
			});
	});
	
	$('#innerSubmit').live('click', function(){
		var styleType= $("input[name='styleType']:checked").val();
		var dianneiName= $("input[name='dianneiName']:checked").val();
		var rowCount= $("input[name='rowCount']:checked").val();
		var cosCount= $("input[name='cosCount']:checked").val();
		var showType= $("input[name='showType']:checked").val();
		var sortType= $("input[name='sortType']:checked").val();
		var dianneiName2=$("#dianneiName2").val();
		if(dianneiName2.length!=0)
			dianneiName=dianneiName2;
		
	 	$.ajax({
			  type:"post",
			  url: "innerStore/getinnserStroeBody",
			  data:{styleType:styleType,
				  tuiguangName:dianneiName,
				  cosCount:cosCount,
				  rowCount:rowCount,
				  showType:showType,
				  sortType:sortType
				 },
			  success: function(data){
				  alert(data);
			    $('#inbody').append(data);
			  }
			}); 
	});
	
	
});
</script>
<body>
<div id="warp">
店内推广功能${gaga} <button id="addMsg">添加测试代码</button><div id="showRadio"></div>
<div id="container">
	<div class="content-box">
		<form action="" method="post">
			<div>基本设置</div>
			<div>
				样式选择<br>
				<input type="radio" id="styleType" name="styleType"  value="" checked="checked">红色&nbsp;
				<input type="radio" id="styleType" name="styleType"  value="">绿色&nbsp;
				<input type="radio" id="styleType" name="styleType"  value="">蓝色&nbsp;
				<input type="radio" id="styleType" name="styleType"  value="">黄色&nbsp;
				<input type="radio" id="styleType" name="styleType"  value="">橙色&nbsp;
			</div>
			<div>
				推广名称<br>
				<input type="radio" id="dianneiName" name="dianneiName"  value="热门推广" checked="checked">热门推广&nbsp;
				<input type="radio" id="dianneiName" name="dianneiName"  value="相关推广">相关推广&nbsp;
				<input type="text" id="dianneiName2" name="dianneiName2"  value="">自定义推广
			</div>
			<div>
				每行显示<br>
				<input type="radio" id="rowCount" name="rowCount"  value="1">1&nbsp;
				<input type="radio" id="rowCount" name="rowCount"  value="2">2&nbsp;
				<input type="radio" id="rowCount" name="rowCount"  value="3">3&nbsp;
				<input type="radio" id="rowCount" name="rowCount"  value="4">4&nbsp;
				<input type="radio" id="rowCount" name="rowCount"  value="5" checked="checked">5
				&nbsp;&nbsp;&nbsp;&nbsp;<font color="red">每行最大显示5个商品</font>
			</div>	
			<div>
				每列显示<br>
				<input type="radio" id="cosCount" name="cosCount"  value="1" checked="checked">1&nbsp;
				<input type="radio" id="cosCount" name="cosCount"  value="2">2&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;<font color="red">最大选择列为2列</font>
			</div>
			<div>
				显示位置<br>
				<input type="radio" id="showType" name="showType"  value="1" checked="checked">居上对齐&nbsp;
				<input type="radio" id="showType" name="showType"  value="2">居下对齐&nbsp;
			</div>
			
			<div>
				商品排序显示<br>
				<input type="radio" id="sortType" name="sortType"  value="" checked="checked">随机&nbsp;
				<input type="radio" id="sortType" name="sortType"  value="modified:desc">最新商品&nbsp;
				<input type="radio" id="sortType" name="sortType"  value="list_time:desc">上架时间升序&nbsp;
				<input type="radio" id="sortType" name="sortType"  value="list_time:asc">上架时间降序&nbsp;
				<input type="radio" id="sortType" name="sortType"  value="">自定义商品&nbsp;
			</div>
		</form>
			<button id="innerSubmit" class="button">一键修改</button>
			<button id="return" class="button">返   回</button>
			<div id="inbody"></div>
		</div>
	</div>
</div>
</body>
</html>